const { Schema, SchemaTypes } = require('../schema');
const OrderStatus = require('../../module/const/OrderStatus');
// 余额消费记录
class ChargeConsumeRecord extends Schema {
    PropertyModelDataTemplate () {
        return {
            userId: { type: SchemaTypes.ObjectId, required: true },
            areaId: { type: SchemaTypes.ObjectId, required: true },
            orderId: { type: SchemaTypes.ObjectId, required: true, comment: '订单id' },
            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() },

            price: { type: SchemaTypes.Number, required: true, comment: '消费金额' },
            status: { type: SchemaTypes.Number, required: true, default: OrderStatus.Payed.value, comment: '消费记录状态，预订单同步' },
            cancelTime: { type: SchemaTypes.Number, required: false }
        };
    }
}

module.exports = ChargeConsumeRecord;
